﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="WindowBorderStyle" TargetType="Border">
        <Setter Property="BorderBrush" Value="{StaticResource StandardGradient}"/>
        <Setter Property="BorderThickness" Value="10"/>
        <Setter Property="CornerRadius" Value="10"/>
    </Style>
    <Style x:Key="BackgroundRectangleStyle" TargetType="Rectangle">
        <Setter Property="Fill" Value="White"/>
        <Setter Property="Margin" Value="5"/>
    </Style>
    <Style x:Key="GroupingBorderStyle" TargetType="Border">
        <Setter Property="BorderBrush" Value="{StaticResource StandardGradient}"/>
        <Setter Property="BorderThickness" Value="4"/>
        <Setter Property="CornerRadius" Value="10"/>
    </Style>
    <Style x:Key="GroupingTextBlockStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource StandardDarkControlSolidColorBrush}"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Padding" Value="2,0,2,0"/>
        <Setter Property="Margin" Value="8,-8,0,0"/>
    </Style>
    <Style x:Key="NoChromeButton" TargetType="{x:Type Button}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Name="Chrome" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="#ADADAD"/>
                            <Setter Property="Opacity" TargetName="Chrome" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="GenericButtonStyle" TargetType="Button">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Foreground" Value="{StaticResource StandardDarkControlSolidColorBrush}"/>
        <Setter Property="Background" Value="White"/>
        <!--<Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush>
                    <GradientStop Color="{StaticResource StandardLightControlColor}" Offset="0.30"/>
                    <GradientStop Color="{StaticResource StandardDarkControlColor}" Offset="0.70"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Name="ButtonBorder" BorderThickness="1" BorderBrush="{StaticResource StandardDarkControlSolidColorBrush}" Background="{TemplateBinding Background}">
                        <Grid>
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Cursor" Value="Hand"/>
                            <Setter Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect Color="{StaticResource StandardDarkControlColor}" ShadowDepth="0" BlurRadius="20"/>
                                </Setter.Value>
                            </Setter>
                            <!--<Setter Property="Background" Value="White"/>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetProperty="Foreground.Color" To="{StaticResource StandardDarkControlColor}" Duration="0:0:0.5"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetProperty="Foreground.Color" To="White" Duration="0:0:0.5"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>-->
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect Color="{StaticResource StandardDarkControlColor}" ShadowDepth="0" BlurRadius="40"/>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Background" Value="White"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource StandardLightControlSolidColorBrush}"/>
                            <!--<Setter Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush>
                                        <GradientStop Color="White" Offset="0.10"/>
                                        <GradientStop Color="LightGray" Offset="0.70"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="Button" BasedOn="{StaticResource GenericButtonStyle}"/>
    <Style x:Key="StandardCheckBoxStyle" TargetType="CheckBox">
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource StandardDarkControlSolidColorBrush}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="CheckBoxBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid x:Name="MarkGrid">
                                <Path x:Name="OptionMark" Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z" Fill="{DynamicResource StandardDarkControlSolidColorBrush}" Margin="1" Opacity="0" Stretch="None"/>
                                <Rectangle x:Name="IndeterminateMark" Fill="{DynamicResource StandardDarkControlSolidColorBrush}" Margin="2" Opacity="0"/>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Padding" Value="4,-1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="CheckBoxBorder" Value="Transparent"/>
                            <Setter Property="BorderBrush" TargetName="CheckBoxBorder" Value="{DynamicResource StandardDarkControlSolidColorBrush}"/>
                            <Setter Property="Fill" TargetName="OptionMark" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                            <Setter Property="Fill" TargetName="IndeterminateMark" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" TargetName="CheckBoxBorder" Value="Transparent"/>
                            <Setter Property="BorderBrush" TargetName="CheckBoxBorder" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                            <Setter Property="Fill" TargetName="OptionMark" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                            <Setter Property="Fill" TargetName="IndeterminateMark" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                            <Setter Property="Foreground" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" TargetName="CheckBoxBorder" Value="Transparent"/>
                            <Setter Property="BorderBrush" TargetName="CheckBoxBorder" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                            <Setter Property="Fill" TargetName="OptionMark" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                            <Setter Property="Fill" TargetName="IndeterminateMark" Value="{DynamicResource StandardLightControlSolidColorBrush}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Opacity" TargetName="OptionMark" Value="1"/>
                            <Setter Property="Opacity" TargetName="IndeterminateMark" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Opacity" TargetName="OptionMark" Value="0"/>
                            <Setter Property="Opacity" TargetName="IndeterminateMark" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>